home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Rexx / Catalog.pprx < prev    next >
Text File  |  2000-05-08  |  25KB  |  867 lines

  1. /* Personal Paint Amiga Rexx script - Copyright © 1996, 1997 Cloanto Italia srl */
  2.  
  3. /* $VER: Catalog.pprx 1.3 */
  4.  
  5. /** ENG
  6.  This script creates reference catalogs ("thumbnails") for the images
  7.  contained in the specified directory.
  8.  
  9.  The first requester can be used to select the catalog background
  10.  (white, gray, or black), the number of thumbnail columns (i.e. images
  11.  per row) and the temporary file directory used by the script. It is also
  12.  possible to decide whether an optimized palette should be generated for
  13.  each catalog (based on thumbnail colors) or not (the palette of the
  14.  current environment is used). The "Test Mode" option quickly shows
  15.  a sample catalog preview based on the current settings.
  16.  
  17.  The catalog format is based on the current image format (width, height,
  18.  aspect ratio and number of colors). This also affects the number of
  19.  catalog files generated.
  20.  
  21.  If not in test mode, two file requesters follow: the first one can be used
  22.  to select the source directory, the second one to select the destination
  23.  directory (where the catalog files will be saved), the root of the file
  24.  name and the file format/options. If the base name contains one or more
  25.  consecutive "0" characters, they will be used and progressively replaced
  26.  to store the catalog number (e.g. "Cat_000.pic" becomes "Cat_001.pic",
  27.  "Cat_002.pic", etc.).
  28.  
  29.  If a catalog file (matching the specified base name) already exists in
  30.  the destination directory, a message asks for confirmation before deleting
  31.  the old files.
  32.  
  33.  Several program settings affect the quality of the catalog images
  34.  generated by this script. These settings are: Color Reduction, Dithering,
  35.  Color Average Resize. For best-quality results, the
  36.  Floyd-Steinberg/Best Quality dithering should be selected, the
  37.  Color Average Resize option should be activated and an appropriate image
  38.  format should be used (the higher the number of colors, the better):
  39.  this is likely to slow down the generation of the catalog, but greatly
  40.  enhances the quality of the thumbnail catalogs.
  41. */
  42.  
  43. /** DEU
  44.  Dieses Skript ermöglicht die Erstellung eines Bilderkatalogs mit
  45.  verkleinerten Abbildungen der in einem Verzeichnis enthaltenen
  46.  Grafiken (sog. "Thumbnails").
  47.  
  48.  Im ersten Dialogfenster lassen sich Elemente wie der Seitenhintergrund
  49.  (wahlweise Weiß, Grau oder Schwarz), Spaltenanzahl (d. h.
  50.  die Anzahl der Bilder pro Zeile) und das temporäre Dateiverzeichnis für
  51.  das Skript festlegen. Es besteht darüber hinaus auch die Möglichkeit,
  52.  für jeden Katalog eine (auf der Palette der Kleingrafiken
  53.  basierende) Palette generieren zu lassen. Wird dies nicht gewünscht,
  54.  verwendet das Skript die Palette der aktuellen Arbeitsumgebung.
  55.  Mit Hilfe der Option "Testmodus" läßt sich eine
  56.  Katalogvorschau auf der Grundlage der aktuellen Einstellungen anzeigen.
  57.  
  58.  Das Format des Bilderkatalogs basiert grundsätzlich auf dem aktuellen
  59.  Bildformat (Breite, Höhe, Seitenverhältnis und Anzahl der Farben).
  60.  Auch die Anzahl der erzeugten Katalogdateien wird dadurch beeinflußt.
  61.  
  62.  Wenn Sie sich nicht im Testmodus befinden, werden noch zwei weitere
  63.  Dateiauswahlfenster geöffnet: Das erste dient zur Auswahl des Quell-,
  64.  und das zweite entsprechend zur Festlegung des Zielverzeichnisses
  65.  (dort werden die Katalogdateien gespeichert) sowie des Dateinamenstamms
  66.  und einiger Optionen bezüglich des Dateiformats. Wenn der Stamm des
  67.  Dateinamens eine oder mehrere aufeinanderfolgende Nullen "0" enthält,
  68.  werden diese zur Speicherung der Katalognummer verwendet. Beispiel:
  69.  "Katze_000.pic" wird zu "Katze_001.pic", "Katze_002.pic", usw.
  70.  
  71.  Ist im Zielverzeichnis bereits eine Katalogdatei mit dem angegebenen
  72.  Namensstamm vorhanden, so erscheint vor dem Überschreiben der alten
  73.  Dateien zunächst eine Sicherheitsabfrage.
  74.  
  75.  Die Qualität der für den Bilderkatalog erzeugten Kleingrafiken läßt sich
  76.  durch die folgenden Programmeinstellungen beeinflussen:
  77.  Farbreduzierung, Fehlerverteilung, "Farben mit Größe ändern".
  78.  Um ein optimales Ergebnis zu erzielen, sollte wie folgt vorgegangen
  79.  werden: Schalten Sie als Ditheringverfahren "Floyd-Steinberg" ein,
  80.  aktivieren Sie die Option "Farben mit Größe ändern", und verwenden Sie
  81.  ein geeignetes Bildformat, wobei gilt: Je mehr Farben, desto besser.
  82.  Dies erfordert zwar u. U. einen größeren Zeitaufwand, liefert aber eine
  83.  erheblich verbesserte Qualität der im Bilderkatalog enthaltenen Grafiken.
  84. */
  85.  
  86. /** ITA
  87.  Questo script crea cataloghi di riferimento ("miniature") delle immagini
  88.  presenti nel cassetto specificato.
  89.  
  90.  Si può usare la prima finestra di dialogo per scegliere lo sfondo del
  91.  catalogo (bianco, grigio o nero), il numero di colonne per le miniature
  92.  (numero di immagini per riga) e il cassetto temporaneo per file usato
  93.  dallo script. È anche possibile decidere se creare una tavolozza ottimizzata
  94.  per ciascun catalogo (in base ai colori delle miniature) o no (si utilizza
  95.  la tavolozza dell'ambiente corrente). L'opzione "Prova" visualizza in modo
  96.  rapido un'anteprima di esempio del catalogo in base alle impostazioni correnti.
  97.  
  98.  Il formato del catalogo si basa su quello dell'immagine corrente (larghezza,
  99.  altezza, aspetto e numero di colori). Ciò determina anche il numero di
  100.  file di catalogo generati.
  101.  
  102.  Se non si è in modo prova, si aprono due finestre per scelta file: la prima
  103.  si può usare per selezionare il cassetto di origine, la seconda per indicare
  104.  quello di destinazione (quello in cui saranno salvati i file dei cataloghi),
  105.  radice (parte costante) del nome file e formato/opzioni file. Se il nome di
  106.  base del file contiene uno o più caratteri "0" consecutivi, essi saranno usati
  107.  e progressivamente incrementati per immagazzinare il numero di riferimento
  108.  all'interno del catalogo (es. "Cat_000.pic" diventa "Cat_001.pic",
  109.  "Cat_002.pic", ecc.).
  110.  
  111.  Se nel cassetto di destinazione esiste già un file di catalogo (avente un
  112.  nome base coincidente con quello specificato), un messaggio chiederà conferma
  113.  prima della cancellazione dei vecchi file.
  114.  
  115.  Diverse impostazioni del programma influenzano la qualità delle immagini del
  116.  catalogo generate da questo script. Questi parametri sono: Riduzione colori,
  117.  Adattamento colori, Rimodellamento con media. Per avere i migliori risultati
  118.  in termini qualitativi, si dovrebbe attivare Floyd-Steinberg/Qualità ottimale,
  119.  Rimodellamento con media e usare un formato immagine appropriato (quanto più
  120.  sarà alto il numero di colori, tanto più sarà migliore il risultato); ciò
  121.  probabilmente rallenterà la creazione del catalogo, ma innalzerà di molto la
  122.  qualità dei cataloghi con immagini in miniatura.
  123. */
  124.  
  125. IF ARG(1, EXISTS) THEN
  126.     PARSE ARG PPPORT
  127. ELSE
  128.     PPPORT = 'PPAINT'
  129.  
  130. IF ~SHOW('P', PPPORT) THEN DO
  131.     IF EXISTS('PPaint:PPaint') THEN DO
  132.         ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
  133.         DO 30 WHILE ~SHOW('P',PPPORT)
  134.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  135.         END
  136.     END
  137.     ELSE DO
  138.         SAY "Personal Paint could not be loaded."
  139.         EXIT 10
  140.     END
  141. END
  142.  
  143. IF ~SHOW('P', PPPORT) THEN DO
  144.     SAY 'Personal Paint Rexx port could not be opened'
  145.     EXIT 10
  146. END
  147.  
  148. ADDRESS VALUE PPPORT
  149. OPTIONS RESULTS
  150. OPTIONS FAILAT 10000
  151.  
  152. Get 'LANG'
  153. IF RESULT = 1 THEN DO        /* Deutsch */
  154.     txt_test_tname    = 'Test.pic'
  155.     txt_title_set     = 'Katalogeinstellungen'
  156.     txt_title_font    = 'Font auswählen'
  157.     txt_title_src     = 'Quellverzeichnis auswählen'
  158.     txt_title_dst     = 'Format und Namensstamm auswählen'
  159.     txt_title_del     = 'Achtung'
  160.     txt_gad_bkg       = '_Hintergrund:'
  161.     txt_gad_bkg0      = 'Weiß'
  162.     txt_gad_bkg1      = 'Grau'
  163.     txt_gad_bkg2      = 'Schwarz'
  164.     txt_gad_colmn     = '_Spalten:'
  165.     txt_gad_recurse   = '_Unterverzeichnisse:'
  166.     txt_gad_workdir   = 'Ar_beitsverzeichnis:'
  167.     txt_gad_makeplt   = '_Palette erzeugen:'
  168.     txt_gad_test      = '_Test:'
  169.     txt_gad_yes       = '_Ja'
  170.     txt_gad_no        = '_Nein'
  171.     txt_msg_del0      = 'Sollen bestehende Alben'
  172.     txt_msg_del1      = 'gelöscht werden?'
  173.     txt_err_oldclient = 'Für dieses Skript_ist eine neuere Version_von Personal Paint erforderlich'
  174.     txt_err_resize    = 'Fehler bei Größenberechnung: '
  175.     txt_err_load      = 'Fehler beim Laden: '
  176.     txt_err_save      = 'Fehler beim Speichern: '
  177.     txt_err_creduc    = 'Fehler bei Farbreduzierung: '
  178.     txt_err_cremap    = 'Fehler bei Farbneuberechnung: '
  179. END
  180. ELSE IF RESULT = 2 THEN DO    /* Italiano */
  181.